how to print patterns in python